﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for util
/// </summary>
public class util
{
	public util()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public static string DATACONNECTION
    {
        get { return System.Configuration.ConfigurationSettings.AppSettings["dataconn"]; }
    }

    public static string GetRandomName(string name)
    {
        string strRet = string.Empty;
        DateTime now = DateTime.Now;
        Random ran = new Random();
        int nRan = ran.Next(999999);
        strRet = String.Format("{0}-{1}", now, nRan);
        strRet = strRet.Replace(":", "");
        strRet = strRet.Replace(" ", "");
        strRet = String.Format("{0}-{1}", strRet, name);
        return strRet;
    }

    public static string GetRandomNum()
    {
        Random ran = new Random();
        int nRan = ran.Next(9999999);
        return nRan.ToString();

    }

    public static string GetResponseAlert(string strText)
    {
        return string.Format("<script>alert('{0}')</script>", strText);
    }
}
